package cn.cboard.dao.sql;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import cn.cboard.dao.TopicQueryDao;
import cn.cboard.database.Query;

public class TopicQueryDaoSql implements TopicQueryDao{
	private final static Logger logger = Logger.getLogger(TopicQueryDaoSql.class);
	private Query query;
	public TopicQueryDaoSql(Query query) {
		this.query = query;
	}

	public Long getLastTopicId(Long forumId, Long threadId) {
		return null;
	}

	public Long getTopicCountOfUser(Long userIdLong) {
		logger.debug("[boardmx]--> entry Topic of user Id:" + userIdLong);
		String sqlquery = "select count(*) from forumtopics where userId=?";
		List queryParams = new ArrayList();
		Long topicCountOfUser = new Long(0);
		try {
			topicCountOfUser = (Long) query.querySingleObject(queryParams, sqlquery);
		} catch (Exception e) {
			logger.error(e);
		}
		
		return topicCountOfUser;
	}

	public Long getTopicCount(Long threadId) {
		return new Long(0);
	}

}
